package DuoTai3;

public interface IShape {
    int a = 10;//静态常量
    void draw();//抽象方法
    default public void test() {//接口变量里非静态有实现方法
    }
    public static void test2() {//接口变量里静态有实现方法
    }
}


abstract class A implements IShape {//继承相当于父类那边过子类{}这边里了
    public abstract void test();
}
class B extends A {

    @Override
    public void draw() {

    }

    @Override
    public void test() {

    }
}
class Rect implements IShape {
    @Override
    public void draw() {
        System.out.println("矩形");
    }
}
class Flower implements IShape {
    @Override
    public void draw() {
        System.out.println("❀");
    }
}


class Test3 {
    public static void drawMap(IShape iShape) {
        iShape.draw();
    }
    public static void main(String[] args) {
        IShape iShape = new Rect();//赋值接转，向上转型到父类了
        IShape iShape2 = new Flower();
        drawMap(iShape);
        drawMap(iShape2);
    }
}
